Function

Define a function

Child elements

ClearPage, Column, Columns, Copy-of, ForAll, Group, LoadDataset, Loop, Message, NextFrame, NextRow, Paragraph, Param, PlaceObject, ProcessNode, SaveDataset, SetVariable, Switch, Td, Tr, Value

Parent elements

Layout

Attributes

name (text)

The name of the function (with namespace prefix).

Example

<Layout xmlns="urn:speedata.de:2009/publisher/en"
        xmlns:sd="urn:speedata:2009/publisher/functions/en"
        xmlns:fn="mynamespace">

        <Record element="data">
            <PlaceObject>
                <Textblock>
                    <Paragraph>
                        <Value select="fn:add(3,4)" />
                    </Paragraph>
                </Textblock>
            </PlaceObject>
        </Record>

        <Function name="fn:add">
            <Param name="a" />
            <Param name="b" />
            <Value select="$a + $b" />
        </Function>
    </Layout>

Print out the number 7.

See also

The chapter about programming.